﻿using AiXiu.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AiXiu.IDAL
{
    public interface IUserService
    {
        /// <summary>
        /// 注册用户
        /// </summary>
        /// <param name="login">登录信息</param>
        /// <returns>返回用户Id</returns>
        int Register(TBLogins login);

        /// <summary>
        /// 用户名是否已存在
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        bool ExistUserName(string userName);

        /// <summary>
        /// 手机号是否已存在
        /// </summary>
        /// <param name="mobileNumber">手机号</param>
        /// <returns></returns>
        bool ExistMobileNumber(string mobileNumber);

        /// <summary>
        /// 通过用户名查找用户信息
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        TBLogins FindByUserName(string userName);

        /// <summary>
        /// 通过手机号查找用户信息
        /// </summary>
        /// <param name="userName">手机号</param>
        /// <returns></returns>
        TBLogins FindByMobile(string mobile);

        /// <summary>
        /// 通过用户编号查找用户信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        TBUsers FindByUserId(int userId);

        /// <summary>
        /// 更新用户信息(不包含头像)
        /// </summary>
        /// <param name="profile"></param>
        /// <returns></returns>
        TBUsers EditUser(TBUsers profile);

        /// <summary>
        /// 编辑头像
        /// </summary>
        /// <param name="profile"></param>
        /// <returns></returns>
        TBUsers EditAvatar(TBUsers profile);

        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <returns></returns>
        List<TBUsers> GetList();

    }
}
